<!doctype html>
<html class="no-js">
<head>
  <include file="./Apps/WebApp/View/default/common_meta.html" />
  <title>提交订单 - {$CONF['mallTitle']}</title>
  <meta name="keywords" content="{$CONF['mallKeywords']},提交订单" />
  <meta name="description" content="{$CONF['mallDesc']},提交订单" />
  <link rel="stylesheet" href="__ROOT__/Apps/WebApp/View/default/AmazeUI/assets/css/amazeui.min.css">
  <link rel="stylesheet" href="__ROOT__/Apps/WebApp/View/default/css/common.css?v={$WST_V}">
  <link rel="stylesheet" href="__ROOT__/Apps/WebApp/View/default/css/wst_page_common.css?v={$WST_V}">
  <link rel="stylesheet" href="__ROOT__/Apps/WebApp/View/default/css/settlement.css?v={$WST_V}">
</head>
<body>
  <div class="wst-page" id="wst-page1">
    <header class="wst-nav">
      <div class="am-g">
        <div class="am-u-sm-2">&nbsp;</div>
        <div class="am-u-sm-8 wst-nav-center">
          <span class="wst-header-center">提交订单</span>
        </div>
        <div class="am-u-sm-2">&nbsp;</div>
      </div>
    </header>

    <div class="settlement-container">
      <input type="hidden" id="addressId" value="{$defaultAddress['addressId']}" autocomplete="off">
		<input type="hidden" id="areaId1" value="{$defaultAddress['areaId1']}" autocomplete="off">
      <input type="hidden" id="totalDeliveryMoneyHidden" value="{$rs['deliveryTotalMoney']}" autocomplete="off">
      <input type="hidden" id="scorePay" value="0" autocomplete="off">
      <input type="hidden" id="scoreMoney" value="{$scoreMoney}" autocomplete="off">
      <input type="hidden" id="isDistributAll" value="{$isDistributAll}" autocomplete="off">

      <?php if($defaultAddress){ ?>
        <div id="addressSelected">
          <a href="#getAddress&{$defaultAddress['addressId']}">
            <div class="am-g am-g-collapse settlement">
              <div class="am-u-sm-11">
                {$defaultAddress['userName']} &nbsp; {$defaultAddress['userPhone']}<br>
                {$defaultAddress['areaName']} &nbsp; {$defaultAddress['address']}
              </div>
              <div class="am-u-sm-1" style="text-align:right;padding-top:7px;"><i class="am-icon-angle-right am-icon-sm"></i></div>
            </div>
          </a>
        </div>
      <?php }else{ ?>
        <div class="am-g am-g-collapse settlement" onclick="javascript:addNewAddress();">
          <div class="am-u-sm-11">
            <img src="__ROOT__/Apps/WebApp/View/default/images/user-address.png" class="settlement-img">本地区没有收货地址，新建一个。
          </div>
          <div class="am-u-sm-1" style="text-align:right"><i class="am-icon-angle-right am-icon-sm"></i></div>
        </div>
      <?php } ?>

      <a href="#orderInfo">
        <div class="am-g am-g-collapse settlement invoice">
          <div class="am-u-sm-7" style="padding-top: 15px;">
            <img src="__ROOT__/Apps/WebApp/View/default/images/order-management.png" class="settlement-img">支付配送，发票信息
          </div>
          <div class="am-u-sm-4 orange-word" style="text-align:right;line-height:20px;">
            <span class="orderinfo" id="payType">{$payTypes[0]['payName']}</span>
            <span class="orderinfo" id="deliveryType">不自提</span>
            <span class="orderinfo" id="isInvoice">不开发票</span>
          </div>
          <div class="am-u-sm-1" style="text-align:right;padding-top: 20px;">
            <i class="am-icon-angle-right am-icon-sm"></i>
          </div>
        </div>
      </a>
      <div class="am-g am-g-collapse settlement">
        <div class="am-u-sm-7" style="line-height:25px;">商品总价格
			<br>
			请选择快递：
			<br>
			<volist name="wuLiu" key="key" id="vo">
				<button>{$vo.catName}</button>&nbsp;&nbsp;&nbsp;&nbsp;
			</volist>
			<br>
		</div>
        <div class="am-u-sm-5 orange-word" style="text-align:right;line-height:25px;"><span id="totalMoney"><?php echo sprintf("%.2f", $rs['goodsTotalMoney']);?></span>元<br>运费：<span id="deliveryTotalMoney"><?php echo sprintf("%.2f", $rs['deliveryTotalMoney']);?></span>元</div>
      </div>

      <volist name="rs['orderInfo']" key="k" id="vo">
        <span class="shopname">{$vo['shopInfo']['shopName']}</span>

        <!-- 优惠套餐 -->
        <volist name="vo['packages']" key="k3" id="vo3">
          <div class="am-g am-g-collapse package-settlement">
            <div class="am-u-sm-8">{$vo3['packageName']}</div>
            <div class="am-u-sm-4 package-price">￥<?php echo sprintf("%.2f", $vo3['shopPrice']);?></div>
            <volist name="vo3['goods']" key="k4" id="vo4">
              <div class="am-g am-g-collapse package-goods-settlement">
                <div class="am-u-sm-3">
                  <input type="hidden" class="shopName" value="{$vo['shopInfo']['shopName']}">
                  <input type="hidden" class="isInvoice" value="{$vo['shopInfo']['isInvoice']}" autocomplete="off">
                  <img src="__ROOT__/{$CONF['goodsImg']}" data-echo="__ROOT__/{$vo4['goodsThums']}" class="order-goods-img">
                </div>
                <div class="am-u-sm-7" style="line-height:25px;">
                  {$vo4['goodsName']}<br>
                  <?php if($vo4["goodsStock"]>0){ ?>
                    <span class="has-goods-stock">有货</span>
                  <?php }else{ ?>
                    <span class="no-goods-stock">无货</span>
                  <?php } ?>
                  &nbsp;
                  <?php if($vo4["goodsSpec"]==1){ ?>规格: {$vo4["goodsSpec"]} <?php } ?>
                </div>
                <div class="am-u-sm-2" style="text-align:right;line-height:25px;">
                  ￥<?php echo sprintf("%.2f", $vo4['shopPrice']);?><br>
                </div>
              </div>
            </volist>
          </div>
        </volist>

        <volist name="vo['goods']" key="k2" id="vo2">
          <div class="am-g am-g-collapse settlement">
            <div class="am-u-sm-3">
              <input type="hidden" class="shopName" value="{$vo['shopInfo']['shopName']}">
              <input type="hidden" class="isInvoice" value="{$vo['shopInfo']['isInvoice']}" autocomplete="off">
              <img src="__ROOT__/{$CONF['goodsImg']}" data-echo="__ROOT__/{$vo2['goodsThums']}" class="order-goods-img">
            </div>
            <div class="am-u-sm-7" style="line-height:25px;">
              {$vo2['goodsName']}&nbsp;&nbsp;&nbsp;&nbsp;总质量：{$vo2['goodsKeywords']*$vo2['goodsCnt']}克/g<br>
				<input type="hidden" class="weight" type="text" value="{$vo2['goodsKeywords']*$vo2['goodsCnt']}"/>
              <?php if($vo2["goodsStock"]>0){ ?>
                  <span class="has-goods-stock">有货</span>
              <?php }else{ ?>
                  <span class="no-goods-stock">无货</span>
              <?php } ?>&nbsp;
              <?php if($vo2["goodsSpec"]==1){ ?>规格: {$vo2["goodsSpec"]} <?php } ?>
            </div>
            <div class="am-u-sm-2" style="text-align:right;line-height:25px;">
              ￥{$vo2['shopPrice']}<br>
            </div>
          </div>
        </volist>
        <div class="am-g am-g-collapse settlement">
          <div class="am-u-sm-2">营业中</div>
          <div class="am-u-sm-10 orange-word" style="text-align:right;line-height:25px;">
            店铺服务时间：{$vo['shopInfo']['serviceStartTime']}-{$vo['shopInfo']['serviceEndTime']}
          </div>
        </div>
        <div class="am-g am-g-collapse settlement">
          <div class="am-u-sm-3" style="padding-top:25px;">商城配送</div>
          <div class="am-u-sm-9 orange-word" style="text-align:right;line-height:25px;">
            配送费：
            <span class="deliveryMoney"><?php if($vo['shopInfo']['deliveryTotalMoney']==0){ echo '免运费';}else{ echo $vo['shopInfo']['deliveryTotalMoney'].'元';}?></span>
            <input type="hidden" class="deliveryMoneyHidden" value="{$deliveryMoney}"><br>
            起送价格：{$vo['shopInfo']['deliveryStartMoney']}元<br>
            包邮起步价：{$vo['shopInfo']['deliveryFreeMoney']}元
          </div>
        </div>
      </volist>
      <?php if($CONF['isOpenScorePay']==1){ ?>
        <div class="am-g am-g-collapse scoremoney">
            <div class="am-u-sm-12">
              <if condition="$userScoreCanUse eq 0">本次不符合积分使用规则，无可用积分<br/></if>
              共{$userScore}个积分，本次可用<span style="color:red;">{$userScoreCanUse}</span>个积分
            </div>
            <div class="am-u-sm-12 score-rules">积分规则：积分满100即可使用，每次使用积分为 n*100</div>
            <if condition="$userScoreCanUse gt 0">
            <div class="am-u-sm-7">
              <i class="check-icon am-icon-circle-thin" id="scorePayIcon"></i>使用积分支付 ￥<?php echo sprintf("%.2f", $scoreMoney);?>
            </div>
            </if>
            <div class="am-u-sm-5 get-score">可获得积分：<?php echo floor($rs['goodsTotalMoney']+$rs['deliveryTotalMoney']);?>个</div>
          </div>
        <?php } ?>
      </div>

    </div>

    <div class="am-g am-g-collapse save-area">
      <div class="am-u-sm-9 total-money" style="padding-left:10px;padding-top:5px;">实际付款：<span id="payMoney"><?php echo sprintf("%.2f", $rs['goodsTotalMoney']+$rs['deliveryTotalMoney']);?></span>元</div>
      <div class="am-u-sm-3 submit-orders" id="save-address" onclick="javascript:submitOrders();">提交订单</div>
    </div>

  </div>
  <div class="wst-page wst-page2" id="wst-page2" style="display:none;"></div>

  <div class="am-modal am-modal-loading am-modal-no-btn" tabindex="-1" id="wst-default-loading">
    <div class="am-modal-dialog">
      <div class="am-modal-hd" id="loadingTips">Loading...</div>
      <div class="am-modal-bd">
        <span class="am-icon-spinner am-icon-spin"></span>
      </div>
    </div>
  </div>
  <include file="./Apps/WebApp/View/default/common_footer.html" />
  <include file="./Apps/WebApp/View/default/address_for_order.html" /><!-- 收货地址的模板 -->
  <include file="./Apps/WebApp/View/default/invoice_info.html" /><!-- 发票等信息的模板 -->

  <include file="./Apps/WebApp/View/default/common_js.html" />
  <script src="__ROOT__/Apps/WebApp/View/default/AmazeUI/assets/js/handlebars.min.js"></script>
  <script src="__ROOT__/Apps/WebApp/View/default/AmazeUI/assets/js/amazeui.widgets.helper.min.js"></script>
  <script src="__ROOT__/Apps/WebApp/View/default/js/wst_page_common.js?v={$WST_V}"></script>
  <script src="__ROOT__/Apps/WebApp/View/default/js/settlement.js?v={$WST_V}"></script>
  <script>
    var payType = "{$payTypes[0]['isOnline']}";
	  $(function(){

	  })
  </script>
</body>
</html>